from time import sleep

from selenium.webdriver.common.by import By
from Base.base_page import BasePage

class addCartPage(BasePage):
    URL = "http://www.testingedu.com.cn:8000/index.php/home/Goods/goodsInfo/id/145"

    addNum = (By.XPATH, "//div[@class='minus-plus']/a[2]")
    addCart = (By.ID, "join_cart")
    close_pop_up = (By.XPATH, "//span[@class='layui-layer-setwin']/a")
    myshopCart = (By.ID, "hd-my-cart")

    def addcart(self):
        self.click(self.addNum)
        self.click(self.addCart)
        sleep(1)
        self.click(self.close_pop_up)
        sleep(1)
        self.click(self.myshopCart)